home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1995
/
MacHack 1995.toast
/
Presentations
/
Presentations ’92
/
Mike Engber (LISP)
/
DTDB.lisp
next >
Wrap
Lisp/Scheme
|
1992-06-07
|
2KB
|
71 lines
(oou-dependencies :macptr-u)
;;
;;init the DTDB refNum
;;
(rlet ((pb :DTPBRec
:ioNamePtr (%null-ptr)
:ioVRefNum 0))
(#_PBDTGetPath pb)
(pref pb :DTPBRec.ioDTRefNum))
(defvar *DTDB-refNum* 848)
;;
;; GetComment
;;
(with-pstrs ((fn "HD:TeachText"))
(%stack-block ((buf 200))
(rlet ((pb :DTPBRec
:ioNamePtr fn
:ioDTRefNum *DTDB-refNum*
:ioDTBuffer buf
:ioDirID 0))
(when (zerop (#_PBDTGetComment pb))
(%get-text buf (pref pb :DTPBRec.ioDTActCount))))))
;;
;; GetIconInfo
;;
(rlet ((pb :DTPBRec
:ioDTRefNum *DTDB-refNum*
:ioIndex 1
:ioTagInfo 0
:ioDTReqCount 1024
:ioFileCreator "RSED"))
(format t "~%~2@a: ~s ~3@s ~4@s~%" #\# 'type 'icon 'size)
(loop
;;break when #$afpItemNotFound
(unless (zerop (#_PBDTGetIconInfo pb)) (return (pref pb :DTPBRec.ioResult)))
(format t "~2@s: ~s ~3@s ~4@s~%"
(pref pb :DTPBRec.ioIndex)
(symbol-name (pref pb :DTPBRec.ioFileType))
(pref pb :DTPBRec.ioIconType)
(pref pb :DTPBRec.ioDTActCount))
(incf (pref pb :DTPBRec.ioIndex))))
;;
;; check out paul
;;
(%stack-block ((buf #$kLarge8BitIconSize))
(rlet ((pb :DTPBRec
:ioDTRefNum *DTDB-refNum*
:ioTagInfo 0
:ioDTBuffer buf
:ioDTReqCount #$kLarge8BitIconSize
:ioIconType -1
:ioFileCreator "RSED"
:ioFileType "paul"
))
(when (zerop (#_PBDTGetIcon pb))
(print (pref pb :DTPBRec.ioDTActCount))
(%get-text buf (pref pb :DTPBRec.ioDTActCount)))))